package com.zhentao.kafka.controller;

import com.alibaba.fastjson.JSON;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

@Component
public class HelloListener {
    @KafkaListener(topics = "tokper")
    public void onData(String message){
            System.out.println(message);

    }
    @KafkaListener(topics = "tokper1")
    public void onData1(String message){
            System.out.println(JSON.parseObject(message));
    }

    @KafkaListener(topics = "itcast")
    public void test1(String message){
        System.out.println(message);
    }
}
